home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Topik
/
Topik - Disk 37 - Games 3 (19xx)(Topik Public Domain)(PD)[WB].zip
/
Topik - Disk 37 - Games 3 (19xx)(Topik Public Domain)(PD)[WB].adf
/
RUMMY
/
SOURCE
/
decl.c.pp
/
decl.c
Wrap
C/C++ Source or Header
|
1991-02-24
|
19KB
|
520 lines
/* DECL.C
* This file contains instances of various structures whose templates are
* contained in the file DEFNS.H. This file should be compiled and linked
* the other modules
*/
#include <intuition/intuition.h>
#include "defns.h"
extern struct Gadget cardgads[];
struct IntuitionBase *IntuitionBase;
struct GfxBase *GfxBase;
struct TextAttr defaultfont =
{ (STRPTR)"topaz.font", TOPAZ_EIGHTY, FS_NORMAL, FPF_ROMFONT },
italicfont = { (STRPTR)"topaz.font", TOPAZ_EIGHTY, FSF_ITALIC, FPF_ROMFONT };
struct NewScreen scrspec =
{
0,0,640,256, 3, 4,1,
HIRES,CUSTOMSCREEN | SCREENBEHIND, &defaultfont,
"Rummy by Simon Preene, Copyright Amiga Computing 1990", NULL,NULL
};
struct Screen *scr;
USHORT chip ptr1[] =
{
0x0000,0x0000,0xfe00,0xfe00,0xfe00,0x8200,0xfc00,0x8400,
0xfc00,0x8400,0xfe00,0x8200,0xff00,0xa100,0xcf80,0xc880,
0x07c0,0x0440,0x03e0,0x0220,0x01f0,0x0110,0x00f8,0x0088,
0x007c,0x0044,0x0038,0x0028,0x0010,0x0010,0x0000,0x0000
};
USHORT chip plr1ptr[] =
{
0x0000,0x0000,0xfe00,0xfe00,0xfe00,0x8200,0xfc00,0x8400,
0xfc00,0x8400,0xfe00,0x8200,0xff00,0xb100,0xcf80,0xc880,
0x07c0,0x0440,0x03e0,0x0220,0x01f0,0x0110,0x00f8,0x0088,
0x007c,0x0044,0x03b8,0x03a8,0x0690,0x0790,0x1c80,0x1f80,
0x1080,0x1f80,0x1c80,0x1f80,0x0480,0x0780,0x0480,0x0780,
0x0480,0x0780,0x0480,0x0780,0x0480,0x0780,0x0480,0x0780,
0x0480,0x0780,0x0480,0x0780,0x0480,0x0780,0x0480,0x0780,
0x0480,0x0780,0x3cf0,0x3ff0,0x2010,0x3ff0,0x3ff0,0x3ff0,
0x0000,0x0000
};
USHORT chip plr2ptr[] =
{
0x0000,0x0000,0xfe00,0xfe00,0xfe00,0x8200,0xfc00,0x8400,
0xfc00,0x8400,0xfe00,0x8200,0xff00,0xb100,0xcf80,0xc880,
0x07c0,0x0440,0x03e0,0x0220,0x01f0,0x0110,0x00f8,0x0088,
0x007c,0x0044,0x0fb8,0x0fa8,0x38f0,0x3ff0,0x2030,0x3ff0,
0x6f10,0x7ff0,0x5990,0x79f0,0x5090,0x70f0,0x7090,0x70f0,
0x0190,0x01f0,0x0130,0x01f0,0x0320,0x03e0,0x0260,0x03e0,
0x06c0,0x07c0,0x0c80,0x0f80,0x1980,0x1f80,0x3338,0x3f38,
0x67e8,0x7ff8,0x4008,0x7ff8,0x4018,0x7ff8,0x7ff0,0x7ff0,
0x0000,0x0000
};
USHORT chip plr3ptr[] =
{
0x0000,0x0000,0xfe00,0xfe00,0xfe00,0x8200,0xfc00,0x8400,
0xfc00,0x8400,0xfe00,0x8200,0xff00,0xb100,0xcf80,0xc880,
0x07c0,0x0440,0x03e0,0x0220,0x01f0,0x0110,0x00f8,0x0088,
0x007c,0x0044,0x0fb8,0x0fa8,0x38d0,0x3fd0,0x2060,0x3fe0,
0x6e20,0x7fe0,0x5b20,0x7be0,0x5320,0x73e0,0x7660,0x77e0,
0x0cc0,0x0fc0,0x0860,0x0fe0,0x0e30,0x0ff0,0x0310,0x03f0,
0x0190,0x01f0,0x0090,0x00f0,0x0090,0x00f0,0x79b0,0x79f0,
0x4f20,0x7fe0,0x4660,0x7fe0,0x61c0,0x7fc0,0x3f00,0x3f00,
0x0000,0x0000
};
struct custptr ptrs[] =
{
{ ptr1,14,16,-1,0 },
{ plr1ptr, 31,16,-1,0, },
{ plr2ptr, 31,16,-1,0 },
{ plr3ptr, 31,16,-1,0 }
};
struct playerinfo plr1 =
{ 1,1,"User",4,0,1,NULL,0,P1DX,P1DY };
struct playerinfo plr2 =
{ 0,0,"Lisa",4,0,2,NULL,0,P2DX,P2DY };
struct playerinfo plr3 =
{ 0,0,"Mike",4,0,3,NULL,0,P3DX,P3DY };
/* The memory and hand arrays will be set by the program */
/* Extra space in name fields is so that user can change name easily */
struct playerinfo *plr[] =
{ NULL,&plr1,&plr2,&plr3 };
USHORT chip faceinfo[] = /*data for full face boolinfo*/
{
0x0fff,0xffff,0xffff,0xfff0,0x3fff,0xffff,0xffff,0xfffc,
0x7fff,0xffff,0xffff,0xfffe,0x7fff,0xffff,0xffff,0xfffe,
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
0x7fff,0xffff,0xffff,0xfffe,0x7fff,0xffff,0xffff,0xfffe,
0x3fff,0xffff,0xffff,0xfffc,0x0fff,0xffff,0xffff,0xfff0
},
chip edgeinfo[] = /*data for edge boolinfo*/
{
0x0fff,0xfff0,0x3fff,0xf000,
0x7fff,0xe000,0x7fff,0xe000,
0xffff,0x0000,0xffff,0x0000,
0xffff,0x0000,0xffff,0x0000,
0xffff,0x0000,0xffff,0x0000,
0xffff,0x0000,0xffff,0x0000,
0xffff,0x0000,0xffff,0x0000,
0xffff,0x0000,0xffff,0x0000,
0xffff,0x0000,0xffff,0x0000,
0xffff,0x0000,0xffff,0x0000,
0xffff,0x0000,0xffff,0x0000,
0xffff,0x0000,0xffff,0x0000,
0xffff,0x0000,0xffff,0x0000,
0xffff,0x0000,0xffff,0x0000,
0xffff,0x0000,0xffff,0x0000,
0xffff,0x0000,0xffff,0x0000,
0xffff,0x0000,0xffff,0x0000,
0xffff,0x0000,0xffff,0x0000,
0xffff,0x0000,0xffff,0x0000,
0xffff,0x0000,0xffff,0x0000,
0xffff,0x0000,0xffff,0x0000,
0xffff,0x0000,0xffff,0x0000,
0x7fff,0x8000,0x7fff,0x8000,
0x3fff,0xe000,0x0fff,0xe000,
0x0fff,0xf000,0x07ff,0xfff0
};
struct BoolInfo wide = { BOOLMASK, faceinfo, NULL},
narrow = { BOOLMASK, edgeinfo, NULL};
char handbuf[4]="7",undo[4][30]; /*each name gadget has its own undo buffer*/
struct StringInfo strinfo[] =
{
{ (UBYTE *)plr1.name,undo[0], 0,16,0,0,16,16,0,0,NULL,0,NULL },
{ (UBYTE *)plr2.name,undo[1], 0,16,0,0,16,16,0,0,NULL,0,NULL },
{ (UBYTE *)plr3.name,undo[2], 0,16,0,0,16,16,0,0,NULL,0,NULL },
{ handbuf,undo[3], 0,4,0,0 }
};
USHORT bcrds[][10] =
{
{ 0,0, 16*FWIDTH+3,0, 16*FWIDTH+3,FHEIGHT+3, 0,FHEIGHT+3, 0,0 },
{ 0,0, 8*FWIDTH+3,0, 8*FWIDTH+3,FHEIGHT+3, 0,FHEIGHT+3, 0,0 },
{ 0,0, 14*FWIDTH+3,0, 14*FWIDTH+3,FHEIGHT+3, 0,FHEIGHT+3, 0,0 },
{ 0,0, 4*FWIDTH+3,0, 4*FWIDTH+3,FHEIGHT+1, 0,FHEIGHT+1, 0,0}
};
struct Border brd[] =
{
{ -2,-2,2,1, JAM1, 5, bcrds[0], NULL },
{ 0,0,2,1, JAM1, 5, bcrds[1], NULL },
{ 0,0,2,1, JAM1, 5, bcrds[2], NULL },
{ -1,-1,2,1, JAM1, 5, bcrds[3], NULL}
};
struct IntuiText gadtxt[] =
{
{ 2,1,JAM2,2,2,NULL, "Continue", NULL },
{ 2,1,JAM2,2,2,NULL, "Submit New Set", NULL },
{ 1,0,JAM2,-14 * FWIDTH + 2,1,NULL, "No of Rounds",NULL}
};
struct Gadget stdgad[] =
{
{ &stdgad[1],P1DX+NGPX,P1DY+NGPY,16*FWIDTH,FHEIGHT, GADGHCOMP,NULL,
STRGADGET, (APTR)&brd[0], NULL,NULL,NULL, (APTR)&strinfo[0],
N1G,NULL
},
{ &stdgad[2],P2DX+NGPX,P2DY+NGPY,16*FWIDTH,FHEIGHT, GADGHCOMP,NULL,
STRGADGET, (APTR)&brd[0], NULL,NULL,NULL, (APTR)&strinfo[1],
N2G,NULL
},
{ NULL,P3DX+NGPX,P3DY+NGPY,16*FWIDTH,FHEIGHT, GADGHCOMP,NULL,
STRGADGET, (APTR)&brd[0], NULL,NULL,NULL, (APTR)&strinfo[2],
N3G,NULL
}, /*not linked to gad[4] since rest only needed during gameplay*/
{ &stdgad[4],IDX+175,IDY+55,8*FWIDTH+4,FHEIGHT+4,GADGHCOMP,RELVERIFY,
BOOLGADGET, (APTR)&brd[1], NULL, &gadtxt[0], NULL,NULL,CONTG,NULL
},
{ &stdgad[5],500,15,14*FWIDTH+4,FHEIGHT+4,GADGHCOMP,RELVERIFY,
BOOLGADGET, (APTR)&brd[2], NULL, &gadtxt[1], NULL,NULL,SUBMITG,NULL
},
{ &stdgad[6],FUPX-2,FUPY-2,CARDW+4,CARDH+4,GADGHBOX, TOGGLESELECT | RELVERIFY,
BOOLGADGET, NULL,NULL,NULL,NULL,NULL,FUPG,NULL
},
{ &stdgad[7],FDPX-2,FDPY-2,CARDW+4,CARDH+4,GADGHBOX, TOGGLESELECT | RELVERIFY,
BOOLGADGET, NULL,NULL,NULL,NULL,NULL,FDPG,NULL
},
{ NULL,NHGADX,NHGADY,10*FWIDTH,FHEIGHT, GADGHCOMP,LONGINT | RELVERIFY,
STRGADGET,(APTR)&brd[3],NULL,&gadtxt[2], NULL,(APTR)&strinfo[3],NHANDG,NULL
}
};
struct Gadget hgads[] = /*hand gadgets for cards*/
{
{ NULL }, /*for correlation with PLRn->HAND[]*/
{ NULL,HANDLEFT,0,64,48,GADGHCOMP, BOOLEXTEND | TOGGLESELECT | RELVERIFY, BOOLGADGET,
NULL,NULL,NULL,NULL,(APTR)&wide, HANDG1, NULL},
{ NULL,HANDLEFT-17,0,17,48,GADGHCOMP,BOOLEXTEND | TOGGLESELECT | RELVERIFY, BOOLGADGET,
NULL,NULL,NULL,NULL,(APTR)&narrow, HANDG2, NULL},
{ NULL,HANDLEFT-17*2,0,17,48,GADGHCOMP,BOOLEXTEND | TOGGLESELECT | RELVERIFY, BOOLGADGET,
NULL,NULL,NULL,NULL,(APTR)&narrow, HANDG3, NULL},
{ NULL,HANDLEFT-17*3,0,17,48,GADGHCOMP,BOOLEXTEND | TOGGLESELECT | RELVERIFY, BOOLGADGET,
NULL,NULL,NULL,NULL,(APTR)&narrow, HANDG4, NULL},
{ NULL,HANDLEFT-17*4,0,17,48,GADGHCOMP,BOOLEXTEND | TOGGLESELECT | RELVERIFY, BOOLGADGET,
NULL,NULL,NULL,NULL,(APTR)&narrow, HANDG5, NULL},
{ NULL,HANDLEFT-17*5,0,17,48,GADGHCOMP,BOOLEXTEND | TOGGLESELECT | RELVERIFY, BOOLGADGET,
NULL,NULL,NULL,NULL,(APTR)&narrow, HANDG6, NULL},
{ NULL,HANDLEFT-17*6,0,17,48,GADGHCOMP,BOOLEXTEND | TOGGLESELECT | RELVERIFY, BOOLGADGET,
NULL,NULL,NULL,NULL,(APTR)&narrow, HANDG7, NULL}
};
struct Gadget setgads[] = /*gadgets for face-up-sets*/
{
{ NULL,0,40,0,48, GADGHBOX, RELVERIFY, BOOLGADGET,
NULL,NULL,NULL,NULL,NULL,SETGAD0,NULL},
{ NULL,0,113,0,48, GADGHBOX, RELVERIFY, BOOLGADGET,
NULL,NULL,NULL,NULL,NULL,SETGAD1,NULL},
{ NULL,0,186,0,48, GADGHBOX, RELVERIFY, BOOLGADGET,
NULL,NULL,NULL,NULL,NULL,SETGAD2,NULL},
{ NULL,0,186,0,48, GADGHBOX, RELVERIFY, BOOLGADGET,
NULL,NULL,NULL,NULL,NULL,SETGAD3,NULL},
{ NULL,0,113,0,48, GADGHBOX, RELVERIFY, BOOLGADGET,
NULL,NULL,NULL,NULL,NULL,SETGAD4,NULL},
{ NULL,0,40,0,48, GADGHBOX, RELVERIFY, BOOLGADGET,
NULL,NULL,NULL,NULL,NULL,SETGAD5,NULL}
};
ULONG setpos[] = {40,113,186,186,113,40};
struct NewWindow winspec =
{
0,0,640,255, 4,1,
GADGETUP | MENUPICK,
SMART_REFRESH | BORDERLESS | BACKDROP | ACTIVATE | NOCAREREFRESH,
stdgad, NULL,NULL,NULL,NULL,
640,246,640,246,
CUSTOMSCREEN
};
struct Window *wind;
struct IntuiText inittxt[] =
{
{ 1,0,JAM1,IDX+180,IDY+12,NULL,"Next Player . . .",&inittxt[1] },
{ 1,0,JAM1,IDX+MESX,IDY+MESY, NULL,"Use Menus To Play",&inittxt[2]},
{ 1,0,JAM1,362,17, NULL,"Submitted Sets",&inittxt[3]},
{ 1,0,JAM1,P1DX+SCTPX,P1DY+SCTPY, NULL,"Score ",&inittxt[4]},
{ 1,0,JAM1,P1DX+HVTPX,P1DY+HVTPY, NULL,"Hand Value ",&inittxt[5]},
{ 1,0,JAM1,P1DX+NWTPX,P1DY+NWTPY, NULL,"Wins ",&inittxt[6]},
{ 1,0,JAM1,P2DX+SCTPX,P2DY+SCTPY, NULL,"Score ",&inittxt[7]},
{ 1,0,JAM1,P2DX+HVTPX,P2DY+HVTPY, NULL,"Hand Value ",&inittxt[8]},
{ 1,0,JAM1,P2DX+NWTPX,P2DY+NWTPY, NULL,"Wins ",&inittxt[9]},
{ 1,0,JAM1,P3DX+SCTPX,P3DY+SCTPY, NULL,"Score ",&inittxt[10]},
{ 1,0,JAM1,P3DX+HVTPX,P3DY+HVTPY, NULL,"Hand Value ",&inittxt[11]},
{ 1,0,JAM1,P3DX+NWTPX,P3DY+NWTPY, NULL,"Wins ",&inittxt[12]},
{ 1,0,JAM1,P1DX+NWTPX,P1DY+NWTPY+9,NULL,"Turn ",&inittxt[13]},
{ 1,0,JAM1,P2DX+NWTPX,P2DY+NWTPY+9,NULL,"Turn ",&inittxt[14]},
{ 1,0,JAM1,P3DX+NWTPX,P3DY+NWTPY+9,NULL,"Turn ",NULL}
},
gt = { 1,0,JAM2,0,0,NULL,NULL,NULL };
struct IntuiText abprtxt = /*about texts*/
{ 2,1,JAM1,2,2,NULL,"Proceed",NULL};
USHORT abprbcrds[] =
{ 0,0, 7*FWIDTH+3,0, 7*FWIDTH+3,FHEIGHT+3, 0,FHEIGHT+3, 0,0};
struct Border abprbrd = /*about gadget border*/
{ 0,0,2,0,JAM1,5,abprbcrds,NULL };
struct Gadget abgad = /*about gadget*/
{ NULL,91,100,7*FWIDTH+4,FHEIGHT+4,GADGHCOMP, RELVERIFY | ENDGADGET,
BOOLGADGET | REQGADGET,(APTR)&abprbrd,NULL,&abprtxt,NULL,NULL,PROCG,NULL
};
USHORT abbrdcrds[] = {0,0,239,0,239,119,0,119,0,0};
struct Border abbrd = {0,0,3,0,JAM1,5,abbrdcrds,NULL};
struct IntuiText abouttxt[] =
{
{ 2,1,JAM1,100,5,NULL,"Rummy", &abouttxt[1]},
{ 4,1,JAM1,60,30,NULL,"By Simon Preene",&abouttxt[2]},
{ 4,1,JAM1,84,45,NULL,"September",&abouttxt[3] },
{ 4,1,JAM1,104,60,NULL,"1990",&abouttxt[4]},
{ 3,1,JAM1,100,15,NULL,"V1.00",&abouttxt[5]},
{ 2,1,JAM1,20,80,NULL,"Copyright Amiga Computing",NULL}
};
struct Requester aboutr = /*about requester*/
{ NULL,200,50,240,120,NULL,NULL,&abgad,&abbrd,&abouttxt[0],NULL,1 };
/*modify memory requester*/
struct IntuiText mmtxt[] =
{
{ 1,1,JAM1,100,4,NULL,"Modify Memory :",&mmtxt[13] },
{ 1,0,JAM1,290,20,NULL,"Memory Flags",NULL} ,
{ 3,1,JAM2,2,2,NULL,"PREVPLRHOLDS",NULL },
{ 3,1,JAM2,2,2,NULL,"CURRPLRHOLDS",NULL },
{ 3,1,JAM2,2,2,NULL,"NEXTPLRHOLDS",NULL },
{ 3,1,JAM2,2,2,NULL,"PREVPLRDROPD",NULL },
{ 3,1,JAM2,2,2,NULL,"CURRPLRDROPD",NULL },
{ 3,1,JAM2,2,2,NULL,"NEXTPLRDROPD",NULL },
{ 3,1,JAM2,2,2,NULL," GONEPAST ",NULL },
{ 3,1,JAM2,2,2,NULL," INFUPSET ",NULL },
{ 2,1,JAM2,2,2,NULL," Save ",NULL },
{ 2,1,JAM2,2,2,NULL," Accept ",NULL },
{ 2,1,JAM2,2,2,NULL," Cancel ",NULL },
{ 1,1,JAM1,225,4,NULL,"",&mmtxt[1]} /*player name filled in*/
};
USHORT mmbcrds[2][10] = /*modmem border coords*/
{
{ 0,0, 12*FWIDTH+3,0, 12*FWIDTH+3,FHEIGHT+3, 0,FHEIGHT+3, 0,0 },
{ 1,1, 12*FWIDTH+2,1, 12*FWIDTH+2,FHEIGHT+2, 1,FHEIGHT+2, 1,1 }
};
USHORT mmmainbcrds[] =
{ 0,0, 399,0, 399,219, 0,219, 0,0};
struct Border innerbrd = /*inner border for modmem gadgets*/
{ 0,0,0,1,JAM2,5,mmbcrds[1],NULL};
struct Border mmbrd = /*modify memory border*/
{ 0,0,3,1,JAM1,5,mmbcrds[0],&innerbrd };
struct Border mmmainbrd =
{ 0,0,1,1,JAM1,5,mmmainbcrds,NULL};
struct Gadget mmgads[] = /*modmem gadgets*/
{
{ &mmgads[1],290,30,12*FWIDTH+4,FHEIGHT+4,GADGHCOMP, TOGGLESELECT, BOOLGADGET | REQGADGET,
(APTR)&mmbrd,NULL,&mmtxt[2],NULL,NULL,NULL,NULL },
{ &mmgads[2],290,43,12*FWIDTH+4,FHEIGHT+4,GADGHCOMP, TOGGLESELECT, BOOLGADGET | REQGADGET,
(APTR)&mmbrd,NULL,&mmtxt[3],NULL,NULL,NULL,NULL },
{ &mmgads[3],290,56,12*FWIDTH+4,FHEIGHT+4,GADGHCOMP, TOGGLESELECT, BOOLGADGET | REQGADGET,
(APTR)&mmbrd,NULL,&mmtxt[4],NULL,NULL,NULL,NULL },
{ &mmgads[4],290,69,12*FWIDTH+4,FHEIGHT+4,GADGHCOMP, TOGGLESELECT, BOOLGADGET | REQGADGET,
(APTR)&mmbrd,NULL,&mmtxt[5],NULL,NULL,NULL,NULL },
{ &mmgads[5],290,82,12*FWIDTH+4,FHEIGHT+4,GADGHCOMP, TOGGLESELECT, BOOLGADGET | REQGADGET,
(APTR)&mmbrd,NULL,&mmtxt[6],NULL,NULL,NULL,NULL },
{ &mmgads[6],290,95,12*FWIDTH+4,FHEIGHT+4,GADGHCOMP, TOGGLESELECT, BOOLGADGET | REQGADGET,
(APTR)&mmbrd,NULL,&mmtxt[7],NULL,NULL,NULL,NULL },
{ &mmgads[7],290,108,12*FWIDTH+4,FHEIGHT+4,GADGHCOMP, TOGGLESELECT, BOOLGADGET | REQGADGET,
(APTR)&mmbrd,NULL,&mmtxt[8],NULL,NULL,NULL,NULL },
{ &mmgads[8],290,121,12*FWIDTH+4,FHEIGHT+4,GADGHCOMP, TOGGLESELECT, BOOLGADGET | REQGADGET,
(APTR)&mmbrd,NULL,&mmtxt[9],NULL,NULL,NULL,NULL },
{ &mmgads[9],290,140,12*FWIDTH+4,FHEIGHT+4,GADGHCOMP, RELVERIFY, BOOLGADGET | REQGADGET,
(APTR)&mmbrd,NULL,&mmtxt[10],NULL,NULL,MMSETFG,NULL},
{ &mmgads[10],290,160,12*FWIDTH+4,FHEIGHT+4,GADGHCOMP, RELVERIFY | ENDGADGET, BOOLGADGET | REQGADGET,
(APTR)&mmbrd,NULL,&mmtxt[11],NULL,NULL,MMACCEPTG,NULL},
{ &cardgads[1],290,173,12*FWIDTH+4,FHEIGHT+4,GADGHCOMP, RELVERIFY | ENDGADGET, BOOLGADGET | REQGADGET,
(APTR)&mmbrd,NULL,&mmtxt[12],NULL,NULL,MMCANCELG,NULL}
},
cardgads[53] = /*fully initialised when used*/
{
{ NULL,0,0,0,48,GADGHCOMP | GADGIMAGE, BOOLEXTEND | RELVERIFY | TOGGLESELECT, BOOLGADGET | REQGADGET,
NULL,NULL,NULL,NULL,NULL,NULL,NULL}
};
struct Requester mmreq = /*modify memory requester*/
{ NULL,120,11,400,220,0,0,&mmgads[0],&mmmainbrd,&mmtxt[0],NULL,0,
NULL,{NULL},NULL,NULL,{NULL} };
/*manual deal requester*/
USHORT mdbcrds[][10] =
{
{ 0,0, 8*FWIDTH+3,0, 8*FWIDTH+3,FHEIGHT+3, 0,FHEIGHT+3, 0,0 },
{ 1,1, 399,1, 399,219, 1,219, 1,1}
};
struct Border mdbrd[] =
{
{ 0,0,3,1,JAM1,5,mdbcrds[0],NULL },
{ 0,0,1,1,JAM1,5,mdbcrds[1],NULL }
};
struct IntuiText mdtxt[] =
{
{ 1,0,JAM1,160,5,NULL, "Manual Deal", NULL},
{ 2,1,JAM2,2,2,NULL,"AutoDeal", NULL},
{ 3,1,JAM2,2,2,NULL," Accept ",NULL },
{ 1,0,JAM1,10,15,NULL,"Select cards for ",NULL}
};
struct StringInfo mdstrinfo =
{ NULL,NULL,0,0,0};
struct Gadget mdgads[] =
{
{ &mdgads[1], 290,50, 8*FWIDTH+4,FHEIGHT+4, GADGHCOMP, RELVERIFY | ENDGADGET,
BOOLGADGET | REQGADGET, (APTR)&mdbrd[0],NULL, &mdtxt[1], NULL,NULL,MDAUTODG,NULL
},
{ &mdgads[2], 500,15, 0,0, GADGHNONE, NULL, STRGADGET | REQGADGET, NULL,
NULL, NULL, NULL,(APTR)&mdstrinfo, NULL,NULL
},
{ &cardgads[1], 290,80, 8*FWIDTH+4,FHEIGHT+4, GADGHCOMP, RELVERIFY,
BOOLGADGET | REQGADGET, (APTR)&mdbrd[0],NULL, &mdtxt[2], NULL,NULL,MDACCEPTG,NULL
}
};
struct Requester mdreq =
{ NULL,220,11,400,220, 0,0, &mdgads[0], &mdbrd[1], &mdtxt[0], NULL,0,
NULL,{NULL},NULL,NULL,{NULL} };
/*display winner requester*/
char intbuf[8][4];
struct IntuiText rwtxt[] =
{
{ 4,1,JAM1,55,10,&italicfont,"Winner Of Round ",&rwtxt[1]},
{ 4,1,JAM1,183,10,&italicfont,intbuf[3],&rwtxt[2]},
{ 4,1,JAM1,207,10,&italicfont," Of ",&rwtxt[3]},
{ 4,1,JAM1,247,10,&italicfont,intbuf[4],&rwtxt[4]},
{ 3,1,JAM1,122,30,NULL,"",&rwtxt[5]},
{ 4,1,JAM1,54,50,&italicfont,"Player Score",&rwtxt[6]},
{ 3,1,JAM1,54,70,NULL,plr1.name,&rwtxt[7]},
{ 3,1,JAM1,230,70,NULL,intbuf[0],&rwtxt[8]},
{ 3,1,JAM1,54,85,NULL,plr2.name,&rwtxt[9]},
{ 3,1,JAM1,230,85,NULL,intbuf[1],&rwtxt[10]},
{ 3,1,JAM1,54,100,NULL,plr3.name,&rwtxt[11]},
{ 3,1,JAM1,230,100,NULL,intbuf[2],NULL}
};
struct Gadget rwgad = /*round winner gadget(copied from about gadget)*/
{ NULL,118,120,7*FWIDTH+4,FHEIGHT+4,GADGHCOMP, RELVERIFY | ENDGADGET,
BOOLGADGET | REQGADGET,(APTR)&abprbrd,NULL,&abprtxt,NULL,NULL,PROCG,NULL
};
USHORT rwbrdcrds[] = {0,0,299,0,299,139,0,139,0,0};
struct Border rwbrd = {0,0,3,0,JAM1,5,rwbrdcrds,NULL};
struct Requester rwreq = /*round winner requester*/
{ NULL,320,30,300,140,0,0,&rwgad,&rwbrd,rwtxt,NULL,7,NULL,{NULL},NULL,NULL,{NULL}};
/*game winner requester*/
struct IntuiText gwtxt[] =
{
{ 4,1,JAM1,94,20,&italicfont,"Winner Of Game",&gwtxt[1]},
{ 2,1,JAM1,122,30,NULL,"",&gwtxt[3]},
{ 4,1,JAM1,110,20,&italicfont,"Game Drawn",&gwtxt[3]},
{ 4,1,JAM1,114,5,&italicfont,"Game Over",&gwtxt[4]},
{ 4,1,JAM1,38,50,&italicfont,"Final Scores For Each Player",&gwtxt[5]},
{ 4,1,JAM1,30,60,NULL,"Player Score Wins",&gwtxt[6]},
{ 3,1,JAM1,30,80,NULL,plr1.name,&gwtxt[7]},
{ 3,1,JAM1,206,80,NULL,intbuf[0],&gwtxt[8]},
{ 3,1,JAM1,30,95,NULL,plr2.name,&gwtxt[9]},
{ 3,1,JAM1,206,95,NULL,intbuf[1],&gwtxt[10]},
{ 3,1,JAM1,30,110,NULL,plr3.name,&gwtxt[11]},
{ 3,1,JAM1,206,110,NULL,intbuf[2],&gwtxt[12]},
{ 3,1,JAM1,256,80,NULL,intbuf[5],&gwtxt[13]},
{ 3,1,JAM1,256,95,NULL,intbuf[6],&gwtxt[14]},
{ 3,1,JAM1,256,110,NULL,intbuf[7],NULL},
};
struct Gadget gwgad = /*game winner gadget(copied from about gadget)*/
{ NULL,118,120,7*FWIDTH+4,FHEIGHT+4,GADGHCOMP, RELVERIFY | ENDGADGET,
BOOLGADGET | REQGADGET,(APTR)&abprbrd,NULL,&abprtxt,NULL,NULL,PROCG,NULL
};
struct Requester gwreq = /*game winner requester*/
{ NULL,150,30,300,140,0,0,&gwgad,&rwbrd,gwtxt,NULL,7,NULL,{NULL},NULL,NULL,{NULL}};
struct Image cardrem = /*blank rectangle to remove cards from screen*/
{ 0,0,64,48,0,NULL,0,0,NULL };
struct Image setrem = /*blank to remove all sets from screen*/
{ 355,30,280,220,0,NULL,0,0,NULL};
struct Image handrem = /*blank to remove user hand*/
{ 0,0,17*6+68,48,0,NULL,0,0,NULL };
struct Image packrem = /*blank to remove both fup and fdp*/
{ 0,0,170,70,0,NULL,0,0,NULL };
USHORT volatile quit=0, mandeal, cont=0, numhand=7, contplay=0, exgm=0, /* exit game */
initpack[2] = {1,0},
shufpack[2] = {1,0}; /*initialise/shuffle pack after hand/game*/
struct Task *tc;
struct MsgPort *mp;
struct set setarr[6]; /*face up set*/
struct set *fupset[] = /*array of pointers to faceupsets*/
{ &setarr[0],&setarr[1],&setarr[2],&setarr[3],&setarr[4],&setarr[5] };
struct card fdp[53], fup[53];
USHORT fuptc,fdptc;
struct Gadget *gaddr;
struct card nulcard =
{ 0,0 };
char out[8];
USHORT ncs,cdsc[10]; /*number of condensed sets*/
struct suitset ss[8];
struct numset ns[14];
struct condset cs[33],selcs[33],testcs[33];